let loading: any;
export const showloading = (title = "") => {
  if (loading) return;
  return new Promise((r) => {
    loading = window.$.confirm({
      title: "",
      content: "",
      type: "loader",
      typeAnimated: true,
      buttons: {
        close: {
          text: "&nbsp",
        },
      },
      onOpen() {
        loading.showLoading(false);
        r(true);
      },
    });
  });
};

export const hideloading = () => {
  if (!!loading) {
    loading.close();
    loading = null;
  }
};
